package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.Schedule;
import com.xmtlxx.tms.domain.bo.ScheduleBo;
import com.xmtlxx.tms.domain.vo.ScheduleVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 车次Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface ScheduleMapper extends BaseMapperPlus<ScheduleMapper, Schedule, ScheduleVo> {
    /**
     * 根据条件分页查询车次
     *
     * @param schedule 车次
     * @return Page Schedule
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.dept_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    Page<ScheduleVo> selectPageScheduleList(@Param("page") Page<Schedule> page,@Param("schedule") ScheduleBo schedule);

    /**
     * 查询车次列表
     *
     * @param schedule 车次
     * @return 车次集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.dept_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    List<ScheduleVo> selectScheduleList(@Param("schedule") ScheduleBo schedule);

    ScheduleVo selectScheduleVoByID(String id);
}
